package org.lanqiao.tjut.controller;



import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lanqiao.tjut.bean.UsersBean;
import org.lanqiao.tjut.bean.UsersBeanTea;
import org.lanqiao.tjut.service.ServiceFactory;

public class UserTeaQueryStu extends HttpServlet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// 设置编码 防止中文乱码
		request.setCharacterEncoding("UTF-8");
		
		
		// 获取id主键值
		String strUid = request.getParameter("uid");
		List<UsersBeanTea> usersBTea = ServiceFactory.getUserInfoManagerTeaServiceInstance().getUserInfoById(strUid);

		
		
		request.getSession().setAttribute("listLong", usersBTea.size());
	
		
		// 将需要显示的结果集放入session缓存中
		request.getSession().setAttribute("lstUsersTea", usersBTea);

		request.removeAttribute("usersB");
		// 转发到结果显示页面
		request.getRequestDispatcher("logined/UserInfoManager/UserTeaQueryStu.jsp").forward(request, response);
		// response.sendRedirect("logined/UserInfoManager/userInfoAddDetail.jsp");

	}

}
